package com.dong.ui.component;

import com.dong.ui.util.IconUtils;
import com.sun.javafx.scene.shape.PathUtils;

import javax.imageio.ImageIO;
import javax.swing.*;

/**
 * @description: 公共窗体
 * @author: 陈瑞东
 * @create: 2021-08-24 11:37
 */
public class CommonFrame extends JFrame {

    private boolean isInit = true; // 是否初始化，配合路由使用

    public CommonFrame(){
        this.setIconImage(IconUtils.getTitleIcon());
        // 设置关闭方式
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//        this.setIconImage(ImageIO.read(new File(PathUtils.getRealPath("logo.png"))));
    }

    public boolean isInit() {
        return isInit;
    }

    /**
     * 初始化结束
     */
    public void afterInit() {
        isInit = false;
    }


}
